package com.yubest.provider.config;

import com.yubest.provider.bean.Version;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Author hweiyu
 * @Description
 * @Date 2022/1/26 16:54
 */
@Configuration
@EnableConfigurationProperties(VersionProperties.class)
public class VersionAutoConfiguration {

    @Bean
    public Version version(VersionProperties prop) {
        Version version = new Version();
        version.setVersion(prop.getVersion());
        version.setDesc(prop.getDesc());
        return version;
    }
}
